Loop & Merge
About Loop & Merge
Loop & merge allows you to take a block of questions and dynamically repeat them multiple times for a respondent.
For a quick example of what loop & merge can do, view our Loop & Merge Example Survey.
Turning on Loop & Merge
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
Once loop & merge is turned on, you can specify how your block of questions will be repeated. Choose to loop based on questions, numbers, or predetermined fields.
The next step is creating and understanding loop & merge fields.
Loop & Merge Fields
Each time you turn on loop & merge, you create loop & merge fields. These fields are used to create dynamic text that is different for each loop.
Each loop has its own set of fields. Field 1 is the “name” of the loop. You can populate Field 1 with answer choices from a previous question, or with manually entered text. Both of these options are described below.
The first loop is Men’s Clothing, the second loop is Women’s Clothing, and so on.
After entering text in Field 1, you can create additional fields. To add or remove fields, click the plus and minus buttons.
To enter text in the additional fields for each loop, click on the field and type text directly into the box. Continue adding and filling fields until you have all the fields you need.
In the first loop of this survey, Field 1 will be Men’s Clothing, Field 2 will be Shorts, and so on. In the second loop, Field 1 will be Women’s Clothing, Field 2 will be Shorts, and so on.
Within the loop & merge block, you can use these fields to customize each loop with piped text. Piping in Field 1 will display the Field 1 text for the loop and piping in Field 2 will display the Field 2 text.
When a respondent is in the Women’s Clothing loop, the first question will read, “How often do you shop in the Women’s Clothing department?” The second question will read, “How often do you purchase Shorts?”
This is how the respondent will see the Field 1 and Field 2 when they’re in the Women’s Clothing loop.
Automatically set Field 1 to the choices of an existing question
To make Field 1 equal to the answer choices of a question you created, select Loop based off of a question. You can then click on the corresponding fields to enter any text you want in Fields 2, 3, etc.
To add or remove additional fields for each answer choice, click the plus ( + ) and minus ( – ) buttons.
Manually enter Field 1
To enter Field 1 manually, click directly on the field and enter text. Do the same for any text you want to have in other fields as well.
To add rows, enter a value in the last row and press Enter on your keyboard.
To remove rows, click the red minus sign ( – ) to the left of each row. To add or remove fields, click the plus ( + ) and minus ( – ) buttons.
Looping Based on a Question
Looping off of a question allows you to present respondents with the same block of questions once for each of a previous question’s choices.
Before setting up this loop & merge, you’ll need at least 2 question blocks in your survey. The first block should contain a question that will determine which loops to show to the respondent. The second block will be looped.
Look at the screenshot above. In the first block (Default Question Block), respondents are asked which departments they shop in. They will then loop through the Product Awareness block once for each department they select.
To loop based on a question
- Click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- Click the Loop based off of a question checkbox.
Qtip: A block can be looped based on the following question types: multiple choice, matrix table, slider, side by side, text entry, rank order, constant sum, pick group and rank, and hot spot. - Select the question with the information to be looped and choose which answer choices to loop through. The answer choice options will vary depending on the question type.
Qtip: You cannot select any questions that are in blocks with loop & merge already enabled.Qtip: If you have Allow Text Entry set up in the question that your loop is based off of, you can choose Selected Choices – Entered Text or All Choices – Entered Text to see the typed answers when piping in fields.
- If desired, select the Randomize Loop Order checkbox. To limit the number of loops shown to each respondent, select Present only [#] of total Loops.
Qtip: Although you can export the responses given for each field, you cannot export the order in which the loops were presented to the respondents.
- Click Save.
Looping Based on a Number
You can use a text-entry question to determine the number of times to loop through a block.
Before setting up this loop & merge, you’ll need at least 2 question blocks in your survey. The first block should contain a text entry question that will determine how many loops to show to the respondent. The second block will be looped.
In the Loop & Merge Condition block, respondents are asked how many children they have. They will then loop through the Age block once for each child.
To Loop based on a Number
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- Select the Loop based off of a question checkbox.
- Select the Text Entry question and choose Numeric Response. Then, specify the maximum number of loops you want to allow.
- If desired, select the Randomize Loop Order checkbox. To limit the number of loops shown to each respondent, select Present only [#] of total loops. Additionally you can add extra information in the other columns of the Loop & Merge settings.
- Click Save.
Static Loop & Merge
You can have the survey loop the same for each respondent by setting up static fields. With static Loop & Merge, you can manually enter the fields that each respondent should loop through.
To loop based on static fields
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- Type directly in the first Field 1 box to specify Field 1 for the first loop (by default, the survey will loop through this block once for each row containing a value in the Field 1 column).
- To add rows, click the last row. To remove rows, click the red minus sign to the left of each row. To add or remove fields, click the plus and minus buttons. For more information on editing and piping text from Fields, see Loop & Merge Fields.
- If desired, select the Randomize Loop Order checkbox. This will randomize the order the loops are shown to your respondents. To limit the number of loops shown to each respondent, select Present only [#] of total loops.
- Click Save.
Randomizing Loop Order
Within a loop & merge block, you can display the loops in a randomized order and limit the number of loops that are displayed to each respondent.
After setting loop & merge on a block, you can access loop randomization settings by clicking the loop & merge icon at the top of the block.
This opens the Loop & Merge dialog box. To turn on loop randomization, select the Randomize Loop Order checkbox. If you want to limit the number of loops shown to each respondent, select Present only __ of total Loops and type a value into the text entry box.
Viewing Loop Order in Your Data
When viewing your data, each loop is treated as a separate set of questions. If you have 5 possible loops, you will see the looped questions repeated 5 times in the data. Even if a respondent isn’t shown all of the loops, all possible loops will be represented in the data.
Loop & Merge Example Data
The question “How often do you shop in the ${lm://Field/1} department?” from our example survey will output raw data that will look similar to this in a CSV file:
The question “How often do you shop in the [Field-1] department?” is repeated 5 times in the data, once for each loop. Any question in the looped block will get a column for each choice in the question it’s looping off, to represent how many times it could’ve been repeated.
[Field-1] will appear in the column title – not the field that was piped in. Use the order of the choices in the original question to determine which column belongs to which choice. For example, if in the first question “Men’s Clothing” is the first choice, the 1_Q9 column is then the data for the loop asking about Men’s Clothing.
Using Logic in Loop & Merge Blocks
In loop & merge blocks, you can base display logic off of which loop the respondent is currently in. You can use this feature to hide a question during certain loops.
This question will be displayed only during the Men’s Clothing loop.
For more information on how display logic based off loop and merge works, see the linked support page.
For more information on how display logic based on questions in a looped block works, see the linked section, towards the bottom.
Turning Off Loop & Merge
Turning off loop & merge will deactivate the loop & merge settings on a block. Respondents who take your survey after the deactivation will move through the block only once (e.g., the block will behave normally).
To turn off Loop & Merge
Loop and Merge in Different Project Types
Loop and merge is only available in a few types of projects, including:
Loop and merge is not available in any Employee Experience projects.